Now I would tell you some basic command which well help you monitor your server.
VZ Parameters
On a Virtuozzo VPS you can output your usage of the VZ parameters. You should pay most attention to oomguarpages and privmpages. Anything with a failure is generally bad!
cat /proc/usr_beancounters
Apache Connections
If you have experience in Server Administrator task, you surely have a headache on the Apache connections when it is getting tons of connections to the server!
Grep port 80 (web services port)
netstat -alntp | grep :80
Check the number of connection from port 80
netstat -alntp | grep :80 | wc -l
ps auxw | grep httpd | wc -l
List the remote IPs connecting to your server on port 80
netstat -ntu | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -nr
List the unique remote IPs and the number of connections from each IP
netstat -alntp | grep :80 | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n
Apache Processes
To find the amount of Apache processes use this command:
ps -A | grep httpd | wc -l
ps -aux | grep httpd
First command will show the process count and second command will show the actual processes.
MySQL Processes
To find the amount of MySQL processes use this command:
ps -A | grep mysql | wc -l (this will show the process count)
ps -aux | grep mysql (this will show the actual processes)
First command will show the process count and second command will show the actual processes.
VPS Usage Live
Now you can see what all processes are running live and how much memory, cpu usage does each process takes and shows the overall server load live too! You can use this command:
top -c
Disk space Usage
You can check out the usage of your server’s HDD of how much data you have been used in any partitions and how much free space left too! Just execute this command:
df -h
I guess these are all the commands used for monitoring your VPS! If there is anything more or have doubts, Please feel free to leave a command!